import socket

PORT = 8088
# 端口一定要和下位机的设置保持一致，并且避开8080和8083端口
# 用我这个程序里写的8088端口就行
FORMAT = 'utf-8'
SERVER = "192.168.58.2"
# 下位机的ip地址是192.168.58.2
ADDR = (SERVER, PORT)

client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(ADDR)


def send(msg):
    message = msg.encode(FORMAT)
    client.send(message)
    print(client.recv(2048).decode())


send("hello, robot arm")
